/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package library.control.st;

import java.util.ArrayList;
import java.util.List;
import library.book.Book;
import library.control.IControlBook;

/**
 *
 * @author MonStar
 */
public class StaticControl implements IControlBook {

    private List<Book> books;

    public StaticControl() {
        books = new ArrayList<>();
        for (int i = 1; i < 10; i++) {
            Book addBook = new Book();
            addBook.setId();
            addBook.setName("Book " + i);
            addBook.setAutor("Autor " + i);
            addBook.setYear(2000 + i);
            addBook.setLink("www.book" + i + ".com");
            books.add(addBook);
        }
    }

    @Override
    public List<Book> getListBooks() {
        return books;
    }

    @Override
    public String getName() {
        return "static";
    }

    @Override
    public List<Book> addBook(Book book) {
        books.add(book);
        return books;
    }

    @Override
    public List<Book> removeBook(Book book) {
        books.remove(book);
        return books;
    }
}
